<%--
  Created by IntelliJ IDEA.
  User: 0xdF
  Date: 2022/11/9
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String userName  = (String) session.getAttribute("user");
%>
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="./css/layui.css">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
    <div>
        <c:if test="${not empty user}">
            <div>
                <ul class="layui-nav">
                    <li class="layui-nav-item"><a href="./logout.jsp">退出</a></li>
                    <li class="layui-nav-item"><a href="./search.jsp">查询</a></li>
                    <li class="layui-nav-item"><a href="./edit.jsp">修改密码</a></li>
                    <li class="layui-nav-item"><a href="./user.jsp">用户管理</a></li>
                    <li class="layui-nav-item"><a href="./del.do?username=<%=userName%>">注销用户</a></li>
                    <li class="layui-nav-item" style="float: right">
                        欢迎您 ： <%=userName %>
                    </li>
                </ul>

            </div>
        </c:if>

        <c:if test="${empty user}">
            <div>
                <ul class="layui-nav">
                    <li class="layui-nav-item"><a href="./login.jsp">登录</a></li>
                    <li class="layui-nav-item"><a href="./loginByEmail.jsp">邮箱登录</a></li>
                    <li class="layui-nav-item">
                        <a href="./register.jsp">注册</a>
                    </li>
                    <li class="layui-nav-item"><a href="./search.jsp">查询</a></li>

                </ul>
            </div>
        </c:if>

    </div>
</body>
</html>
